package com.trendit.print.sdk.models.printer;

import com.trendit.print.sdk.DaquObject;
import com.trendit.print.sdk.DaquRequest;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 设置打印机播报音量（一般用不到）
 */
public class SetPrinterVolumeRequest implements DaquRequest<SetPrinterVolumeResponse> {

    private DaquObject bizModel;

    /**
     * 构造方法
     * @param bizModel
     */

    public SetPrinterVolumeRequest(DaquObject bizModel) {
        this.bizModel = bizModel;
    }

    @Override
    public String getApiMethodName() {
        return "openapi.setVolume";
    }

    @Override
    public String getApiVersion() {
        return "1.0";
    }

    @Override
    public String getNotifyUrl() {
        return null;
    }


    @Override
    public String getApiMethodURL() {
        return "/openapi/set_volume";
    }

    @Override
    public Class<SetPrinterVolumeResponse> getResponseClass() {
        return SetPrinterVolumeResponse.class;
    }

    @Override
    public DaquObject getBizModel() {
        return bizModel;
    }

    @Override
    public String getBizContent() {
        return null;
    }

    @Data
    public static class Model extends DaquObject {

        @NotBlank(message = "设备编号不能为空")
        private String sn;
        /**
         * 声音大小(1-5,声音越来越大)
         */
        @NotNull(message = "音量值不能为空")
        @Min(1)
        @Max(5)
        private Integer volume;

    }
}
